package com.example.agent;

import com.sun.tools.attach.VirtualMachine;

public class AgentLoader {
    public static void main(String[] args) throws Exception {
        String pid = "29796"; // `jps -l` Spring Boot 进程 ID
        VirtualMachine vm = VirtualMachine.attach(pid);
        vm.loadAgent("agent.jar");
        vm.detach();
    }
}

